// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import Common from './assets/js/utils'
import Clipper from './assets/js/clipper'
import Vant from 'vant'
import 'vant/lib/vant-css/index.css'
import VueLazyload from 'vue-lazyload'
// import cropper from 'vue-cropper'
import promise from 'es6-promise'
promise.polyfill()
// Vue.use(cropper)
Vue.use(Common)
Vue.use(Clipper)
Vue.use(VueLazyload)
Vue.use(Vant)

Vue.config.productionTip = false

router.beforeEach((to, from, next) => {
  /* 路由发生变化修改页面title */
  if (to.meta.title) {
    document.title = to.meta.title
  }
  next()
})

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  components: { App },
  template: '<App/>'
})
